package com.xuecheng.api.media;

import com.xuecheng.api.media.model.aliyun.VodUploadRequest;
import com.xuecheng.api.media.model.aliyun.VodUploadToken;
import com.xuecheng.api.media.model.dto.MediaDTO;
import com.xuecheng.api.media.model.qo.QueryMediaModel;
import com.xuecheng.api.media.model.vo.MediaVO;
import com.xuecheng.api.media.model.vo.ResourceUrlModel;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.common.domain.response.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 * 媒资管理 Api 接口
 * </p>
 *
 * @Description:
 */
@Api(value = "媒资管理 Api 接口", tags = "媒资-媒资管理业务服务 Api 接口", description = "媒资管理业务服务 Api 接口")
public interface MediaApi {

    @ApiOperation("创建媒资上传凭证")
    @ApiImplicitParam(name = "vodUploadRequest", value = "媒资上传请求信息",
            required = true, dataType = "VodUploadRequest", paramType = "body")
    VodUploadToken createUploadToken(VodUploadRequest vodUploadRequest);

    @ApiOperation("刷新视频上传凭证，为前端分片上传使用")
    VodUploadToken refreshUploadToken(String videoId);


    @ApiOperation("保存媒资信息数据方法")
    MediaDTO saveMedia(MediaVO vo);

    @ApiOperation("分页条件查询媒资信息")
    @ApiImplicitParam(name = "model", value = "查询条件", dataType = "QueryMediaModel", paramType = "body")
    PageVO queryMediaList(PageRequestParams params, QueryMediaModel model);

    @ApiOperation("预览媒资信息")
    @ApiImplicitParam(name = "mediaId", value = "媒资id", dataType = "Long", paramType = "path")
    Object previewMedia(Long mediaId);

    @ApiOperation("根据id删除媒资信息")
    @ApiImplicitParam(name = "mediaId", value = "媒资id", dataType = "Long", paramType = "path")
    void deleteMedia(Long mediaId);

    @ApiOperation("根据id查询媒资信息")
    @ApiImplicitParam(name = "mediaId", value = "媒资id", dataType = "Long", paramType = "path")
    RestResponse<MediaDTO> getMediaById4s(Long mediaId);

    @ApiOperation(value = "根据媒资ID获取播放地址", hidden = true)
    @ApiImplicitParam(name = "mediaId", value = "媒资ID", required = true, dataType = "long", paramType = "path", example = "1")
    RestResponse<ResourceUrlModel> getMediaUrl(Long mediaId);

}